<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="ture"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="m" value="${movie_info}" />
<!--검색질의 -->
<c:set var="qury" value="&findtype=${ftype}&findkey=${fkey}" />
<c:set var="burl" value="?cpage=" />
<div id="comm_w">
	<form method="post" name="board" id="commentFrm">
		<div id="starsrating">
			<img src="images/star.png" id="starimg" /> <select name="stars"
				id="stars">
				<option value="10" data-image="images/chw-icons/star5.png">별10</option>
				<option value="9" data-image="images/chw-icons/star5.png">별9</option>
				<option value="8" data-image="images/chw-icons/star5.png">별8</option>
				<option value="7" data-image="images/chw-icons/star5.png">별7</option>
				<option value="6" data-image="images/chw-icons/star5.png">별6</option>
				<option value="5" data-image="images/chw-icons/star5.png">별5</option>
				<option value="4" data-image="images/chw-icons/star4.png">별4</option>
				<option value="3" data-image="images/chw-icons/star3.png">별3</option>
				<option value="2" data-image="images/chw-icons/star2.png">별2</option>
				<option value="1" data-image="images/chw-icons/star1.png">별1</option>
				<option value="0" data-image="images/chw-icons/star1.png">별0</option>
			</select>
		</div>
		<div id="commtext">
			<textarea name="comment" id="comment" placeholder="댓글 작성"></textarea>
		</div>
		
		<input type="hidden" name="cpage" id="h_cpage" value="${m.movno}" />

		<div id="btn">
			<button type="button" id="testbutton" onclick="regiComment()" class="btn btn-primary">등 록</button>
		</div>
	</form>
</div>
<div id="content5">

	<table>
		<colgroup>
			<col style="width: 10%" />
			<col style="width: 10%" />
			<col style="width: 70%" />
			<col style="width: 10%" />
		</colgroup>
		

		<!-- 제목행 시작 -->
		<tr>
			<th><h3>NUM</h3></th>
			<th><h3>STARS</h3></th>

			<th><h3>COMMENT</h3></th>
			<th><h3>DATE</h3></th>
		</tr>

		<!-- 제목행 끝 -->
		<c:forEach var="v" items="${listBoards}">
			<!-- 본문행 출력시작 -->
			<tr class="center">
				<td>${v.movno}</td>
				<td>${v.stars}</td>

				<td>${v.comment}</td>
				<td>${v.comm_wdate.substring( 0, 10 ) }</td>

			</tr>
			<!-- 본문행 출력끝 -->
			<%-- 게시물 글번호 수정 --%>
			<c:set var="startbno" value="${ startbno-1 }" />
		</c:forEach>
	</table>
	<p class="center">
		<a href="${burl}1&movno=${m.movno}" title="처음 페이지로 이동합니다"> 처음
		</a>
		<c:if test="${ cpage ne 1 }">
			<a href="${burl}${ cpage-1 }${qury}&movno=${m.movno}"
				title="이전 -1 페이지"> ◀ </a>
		</c:if>
		◁◁
		<c:forEach var="p" begin="${startnav}" end="${startnav+9}">
			<c:if test="${ p le allpage }">

				<c:if test="${ cpage eq p }">
					<span class="cpage"> ${p} </span>
				</c:if>
				<c:if test="${ cpage ne p }">
					<a href="${burl}${p}${qury}&movno=${m.movno}"> ${p}</a>
				</c:if>
			</c:if>
		</c:forEach>
		▷▷ <a href="${burl}${ cpage+1 }${qury}&movno=${m.movno}"
			title="다음 +1 페이지"> ▶ </a> <a
			href="${burl}${allpage}${qury}&movno=${m.movno}"
			title="처음 페이지로 이동합니다"> 끝 </a>
	</p>
</div>